//引入Count的Ui组件
import CountUI from '../../components/Count'
//引入链接UI组件与redux
import {connect} from 'react-redux'
import {createIncrementAction, createIncrementAsyncAction, createDecrementAction} from "../../redux/count_action";


//创建并暴露一个Count的容器组件
export default connect(
    state => ({count: state}),
    // dispatch => ({
    //     //执行redux执行加法
    //     increment: data => dispatch(createIncrementAction(data)),
    //     decrement: data => dispatch(createDecrementAction(data)),
    //     incrementAsync: (data, time) => dispatch(createIncrementAsyncAction(data, time))
    // }),
    {
        //执行redux执行加法
        increment: createIncrementAction,
        decrement: createDecrementAction,
        incrementAsync: createIncrementAsyncAction
    }
)(CountUI);